/*This subjecet by using pointer* and change the value of a,b,c
//////////////////////////////////////
#include <iostream>
using namespace std;
main()
{
	void sort(int*p1,int*p2,int*p3);
	int a,b,c;
	int *a1,*b1,*c1;
	cout<<"Input 3numbers"<<endl;
	cin>>a>>b>>c;
	a1=&a,b1=&b,c1=&c;
	sort(a1,b1,c1);
	cout<<"The sorted numbers are:"<<endl //change the a,b,c value
	    <<a<<" "<<b<<" "<<c<<endl;
	return 0;
}

void sort(int *p1,int *p2,int *p3)
{
	void change(int *,int *);
	change(p1,p2);
	change(p1,p3);
	change(p2,p3);
}

void change(int *m,int *n)
{
	int temp;
	if(*m>*n)
	{
		temp=*m;
		*m=*n;
		*n=temp;
	}
}
//////////////////////////////////////
*/

/*How to change 3numbers and not change the value of a,b,c?*/
/*

#include <iostream>
using namespace std;
main()
{
	void sort(int*p1,int*p2,int*p3);
	int a,b,c;
	int *a1,*b1,*c1;
	cout<<"Input 3numbers"<<endl;
	cin>>a>>b>>c;
	a1=&a,b1=&b,c1=&c;
	sort(a1,b1,c1);
	cout<<"The sorted numbers are:"<<endl //change the a,b,c value
	    <<*a1<<" "<<*b1<<" "<<*c1<<endl;
	return 0;
}

void sort(int *p1,int *p2,int *p3)
{
	void change(int *,int *);
	change(p1,p2);
	change(p1,p3);
	change(p2,p3);
}

void change(int *m,int *n)
{
	int *temp;
	if(*m>*n)
	{
		temp=m;          //only modified this part,to change the pointer pointed to ,but failed 
		m=n;
		n=temp;
	}
}
*/